import 'package:flutter/material.dart';
import 'package:robot3/services.dart';
import 'package:robot3/widgets.dart';

/// 下拉列表 PopupMenuButton的使用
void main() {
  final  themeData  = ThemeData(
    popupMenuTheme: PopupMenuThemeData(
      menuPadding: EdgeInsets.zero,
      color: Colors.red, // 菜单背景颜色
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(0), // 菜单圆角
      ),
      elevation: 8, // 菜单阴影
      textStyle: TextStyle(
        fontSize: 4,
        color: Colors.yellow, // 菜单文字样式
      ),
    ),
  );


  runApp(MaterialApp(
      theme: themeData,
      home: const SecondScreen()));
}

class SecondScreen extends StatelessWidget {
  const SecondScreen({super.key});

  @override
  Widget build(BuildContext context) {
    final map = {
      "关于": "0",
      "关于1": "1",
      "关于2": "2",
    };
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter'
        ),
      ),
      body: RobotPopupMenuButton(
        onItemSelected: (text){},
          map: map,
          width: 374/ratio,height: 44/ratio,itemHeight: 80/ratio,offsetY:44/ratio),
    );
  }
}

